#ifndef TRAJECTORY_H
#define TRAJECTORY_H

#include <QWidget>
#include <vector>
#include "qcustomplot.h"
#include <string>
#include <iostream>
#include <QInputDialog>

using namespace std;

namespace Ui {
class trajectory;
}

class trajectory : public QWidget
{
    Q_OBJECT

public:
    explicit trajectory(QWidget *parent = 0);
    ~trajectory();
    void setupPlot();

private:
    Ui::trajectory *ui;
    QVector<QCPCurveData> target;
    QVector<QCPCurveData> trail;
    pair<double,double> home;
    QVector<pair<double,double>> send;
    double x_pos,y_pos;
    QCPCurve *graphTarget,*graphTrail;

signals:
    void sendData(QVector<pair<double,double>> &v);

public slots:
    void RecvPoint(double x,double y);

private slots:
    void mouseDisplay(QMouseEvent*);
    void clearPoint(void);
    void addCurPoint(void);
    void addPoint(void);
    void removePoint(void);
    void setPointAsHome(void);
    void setHome(void);
    void fixPoint(void);
    void sendPoint(void);
};

#endif // TRAJECTORY_H
